package map.infos;

import com.jme.math.Vector3f;
import com.jme.renderer.ColorRGBA;

import logic.nodes.nodeSettings.Settings;

public class LightMapInfos extends Settings {
	
	private static final String DIRECTION = "direction";
	private static final String AMBIENT = "ambient";
	private static final String DIFFUSE = "diffuse";
	
	public LightMapInfos(Settings settings) {
		super(settings);
	}
	
	public Vector3f getDirection() {
		float[] v = getFloatValues(getValueOf(DIRECTION));
		return new Vector3f(v[0], v[1], v[2]).normalizeLocal();
	}
	
	private ColorRGBA createColor(String key) {
		float[] v = getFloatValues(getValueOf(key));
		return new ColorRGBA(v[0], v[1], v[2], v[3]);
	}
	
	public ColorRGBA getAmbient() { return createColor(AMBIENT); }
	
	public ColorRGBA getDiffuse() { return createColor(DIFFUSE); }
}